<template>
  <z-chart v-if="option" class="z-chart z-line-chart" :option="option" />
</template>

<script>
import {baseChartMixin} from "@/zpkgs/components/z-chart/mixins";

export default {
  name: "ZBarChart",
  mixins: [
      baseChartMixin
  ],
  watch: {
    def: {
      immediate: true,
      handler(o) {
        let records = o.rows
        let columns = o.columns
        this.option = this.$_genOption(records, columns, {
          type: 'bar'
        })
      }
    }
  },
  data() {

    return {
      option: null
    }
  }
}
</script>

<style scoped>

</style>
